package unit.panels;

import com.golden.gamedev.object.Sprite;
/*
 * This vertical flip panel will alter the velocity of a robot on the board
 */
public class VerticalFlipPanel extends AbstractPanel{
	
	private static final long serialVersionUID = 1L;

	public VerticalFlipPanel(Sprite sprite) {
		super(sprite);
	}

	@Override
	public void operate(Sprite sprite) {
		if(sprite.getHorizontalSpeed() != 0){
			sprite.setVerticalSpeed(sprite.getHorizontalSpeed()*-1);
		}
		else{sprite.setVerticalSpeed(sprite.getVerticalSpeed()*-1);
		}
		sprite.setHorizontalSpeed(0);
		
	}

}
